<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>	
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>贺兰后台管理系统——登录</title>
  <!--[if lte IE8]>
  <script>
  		window.location.href = "<%=path%>/include/help/IE8.html?ver=1.0";
  </script>
  <![endif]-->  
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- bootstrap -->  
  <link rel="stylesheet" href="<%=path%>/include/lib/bootstrap-3.3.7-dist/css/bootstrap.min.css" >
  <!-- Font Awesome -->
  <link rel="stylesheet" href="<%=path%>/include/lib/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="<%=path%>/include/lib/Ionicons/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="<%=path%>/include/lib/AdminLTE/css/AdminLTE.min.css"> 
</head>
<body class="hold-transition login-page">
<div class="login-box">
  <div class="login-logo">
    <a href="index"><b>贺兰后台管理系统</b></a>
  </div>
  <!-- /.login-logo -->
  <div class="login-box-body">
    <p class="login-box-msg">请输入用户名和密码登录系统</p>

    <form id="form1" action="login" method="post">
      <div class="form-group has-feedback">
        <input type="text" name="name" class="form-control" placeholder="用户名">
        <span class="glyphicon glyphicon-user form-control-feedback"></span>
      </div>
      <div class="form-group has-feedback">
        <input type="password" class="form-control" placeholder="密码">
        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
      </div>
      <div class="row">
        <div class="col-xs-8">
          <div class="checkbox">
            <label>
              <input type="checkbox"> 记住帐号
            </label>
          </div>
        </div>
        <!-- /.col -->
        <div class="col-xs-4">
          <button type=submit class="btn btn-primary btn-block btn-flat">登录</button>
        </div>
        <!-- /.col -->
      </div>
    </form>   
  </div>
  <!-- /.login-box-body -->
</div>
<!-- /.login-box -->

<!-- jQuery 3 -->
<script type="text/javascript" src="<%=path%>/include/js/jquery-3.2.0.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script type="text/javascript" src="<%=path%>/include/lib/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script>

  $(function () {
  	var form = $("#form1");
	$(":submit").on("click",function(e){
		e.preventDefault();
		$.ajax({
			type: form.attr('method'),
			url: form.attr('action'),
			dataType: 'json',
			cache:false,
			//data: form.serialize(),
			data: {
				name: "1",
				password: "1"
			},
			success: function(data){
				console.log(data);
				if(data.status == 0){
					window.location = "index";
				} else {
					
				}					
			},
			error: function(a,b,c){
				console.log(b);
			}
		});
	});
  });
</script>
</body>
</html>